/*
 * Copyright (C) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ACCESSIBILITY_GESTURE_EVENT_HANDLER_H
#define ACCESSIBILITY_GESTURE_EVENT_HANDLER_H

#include "accessibility_event_info.h"
#include "pointer_event.h"
#include "accessibility_event_transmission.h"

namespace OHOS {
namespace Accessibility {
class GestureEventHandler : public EventTransmission{
public:
    GestureEventHandler();
    ~GestureEventHandler();

    void OnGestureEvent(const AccessibilityEventInfo &uiEvent);

    void HandleInvalidGestureEvent(const AccessibilityEventInfo &uiEvent);

    void HandleFocusMove(const AccessibilityEventInfo &uiEvent);

    bool HandleDoubleTapGestureEvent(const AccessibilityEventInfo &uiEvent);

    /**
     * @brief 处理四指滑动手势，左右切换语言，上下切换声音
     * @param gestureType 手势
     * @return true: 处理成功，false: 处理失败
     */
    bool HandleFourFingerSwipeGestureEvent(const GestureType gestureType);

    /**
     * @brief 将手势映射到action，再通过SR执行action，转化为对应的key重新注入多模
     * @param gestureType 手势
     */
    void ExecuteAction(const GestureType gestureType);
    void ExecuteActionWithSimulateClickForBack(const GestureType gestureType);

private:
    std::shared_ptr<MMI::PointerEvent> pointerEvent_ = nullptr; // to simulate pointer event
};

}// namespace Accessibility
}// namespace OHOS

#endif // ACCESSIBILITY_GESTURE_EVENT_HANDLER_H